<?php
/**
 * This file is form http://findcat.cn
 *
 * @link     https://findcat.cn
 * @email    1476982312@qq.com
 */
namespace Database\Seeder;

use Illuminate\Database\Seeder;
use Blog\Seeder\Admin\Menu\BlogMenuSeeder;
use Blog\Seeder\Admin\Test\TagsTableSeeder;
use Blog\Seeder\Admin\Test\UserTableSeeder;
use Blog\Seeder\Admin\Test\ArticleTableSeeder;
use Blog\Seeder\Admin\Test\CommentTableSeeder;
use Blog\Seeder\Admin\Menu\DashboardMenuSeeder;
use Blog\Seeder\Admin\Test\CategoryTableSeeder;
use Blog\Seeder\Admin\Menu\AdminManagerMenuSeeder;
use Blog\Seeder\Admin\Role\AdminManagerRoleSeeder;
use Blog\Seeder\Admin\Test\ArticleTagsTableSeeder;
use Blog\Seeder\Admin\Test\FriendlyLinkTableSeeder;
use Blog\Seeder\Admin\Permission\BlogPermissionSeeder;
use Blog\Seeder\Admin\Test\EveryDayContentTableSeeder;
use Blog\Seeder\Admin\AdminUsers\AdminManagerUserSeeder;
use Blog\Seeder\Admin\Test\WebsiteAnnouncementTableSeeder;
use Blog\Seeder\Admin\Permission\AdminManagerPermissionSeeder;

class TestBlogInstallDatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     */
    public function run()
    {
        //1、先创建菜单项
        $this->call(DashboardMenuSeeder::class);
        $this->call(AdminManagerMenuSeeder::class);
        $this->call(BlogMenuSeeder::class);

        //2、创建权限
        $this->call(AdminManagerPermissionSeeder::class);
        $this->call(BlogPermissionSeeder::class);

        //3、创建角色并赋予权限
        $this->call(AdminManagerRoleSeeder::class);

        //4、创建管理端用户并分配角色
        $this->call(AdminManagerUserSeeder::class);

        //5、生成测试数据
        $this->call(ArticleTableSeeder::class);
        $this->call(ArticleTagsTableSeeder::class);
        $this->call(CategoryTableSeeder::class);
        $this->call(CommentTableSeeder::class);
        $this->call(EveryDayContentTableSeeder::class);
        $this->call(FriendlyLinkTableSeeder::class);
        $this->call(TagsTableSeeder::class);
        $this->call(UserTableSeeder::class);
        $this->call(WebsiteAnnouncementTableSeeder::class);
    }
}
